<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePhonicsWithdrawTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('phonics_withdraw', function (Blueprint $table) {
            $table->timestamp('updated_at')->useCurrent();
            $table->timestamp('created_at');

            $table->increments('id');
            $table->integer('student_id');
            $table->string('open_id')->nullable()->default(null);
            $table->decimal('amount')->default(0);
            $table->tinyInteger('status')->default(0);
            $table->string('error_code')->nullable()->default(null);
            $table->string('error_message')->nullable()->default(null);

            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('phonics_withdraw');
    }
}
